This repository was archived by the owner on Jul 21, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@vasco-santos This is an initial attempt on the usage example for issue #36.
PS: I don't know whether you're signing your commits in libp2p, I can remove it.
Same goes for any other changes :-)
Add a basic usage example whereby the client code runs on top of each
libp2p DHT node. The idea is that each user has its own deaddrop,
identified by her UserId (on the DHT identifiers namespace), where other
users can leave messages to.
The demo instantiates three application (and thus DHT) nodes. Bootstrap
is handled by having an "always-on" node where others can connect to.
In real world examples, this would not suffice, as a discovery mechanism
needs to be in place (either by using the RandomWalk peer discovery or
by switching any implementations of libp2p/interface-peer-discovery).
Once the nodes are instantiated and connected, thus forming a single
DHT, one deaddrop application (userA) writes a message for userB. Then,
userB reads her messages (after having been informed about the message
through off-channel means).
For this example to make sense, any sent message is encrypted using the
recipient's public key, so that only she can read them, by decrypting
them with her private key.
Resolves #36.
Signed-off-by: Chris Aslanoglou [email protected]